<template>
<div>change-avatar</div>
</template>
<script>
import { updateAvatar } from '@/api/ums/ums.personal.service.js'
export default {
  data () {
    return {
      form: {
        avatar: ''
      },
      rule: {
      }
    }
  },
  methods: {
    submit () {
      return new Promise((resolve, reject) => {
        this.$refs['form'].validate((valid) => {
          if (valid) {
            updateAvatar(this.form).then(res => {
              resolve(res)
            }).catch(e => {
              reject(e)
            })
          } else {
            reject(new Error('error'))
          }
        })
      })
    }
  }
}
</script>
